I. Annual ENQUIRY Enquiry data for the yearSELECT * fromblog_articleWHERE Year(From_unixtime (Blogcreatetime))= Year(Curdate ()) Second, query quarterly data query data with quarter numberSELECTArticleID, Quarter (from_unixtime (' Blogcreatetime ')
MySQL queries a lot of ways, the following for you to introduce the MySQL query is to query this week, last week, this month, the last month's data, if you are interested in MySQL query, may wish to see.Query the current data todaySELECT
The damn mysql does not provide a dedicated unix timestamp processing function. Therefore, if you encounter a time group and you use an integer unix timestamp, only other date types of mysql can be converted! FROM_UNIXTIM () converts unix timestamp
MySQL database gets system time, year, month, day single fetchGet current system date Time: Select Sysdate () as System datetime;Get current system Month Day: Select Current_date as Month day;Gets the current system year: Select Year (current_date)
Damn it. MySQL does not have a specialized processing function for UNIX timestamps, so if you encounter time groupings and you are using an integer UNIX timestamp, only the other date types that are converted to MySQL!From_unixtim () converts a Unix
Recently encountered a problem: the development-time table does not have a time stamp that is used directly for the day month field, but it is counted by days, months, and yearsThis without program processing directly with MySQL can handle:MySQL
MySQL queries the SQL statements used for data from today, this week, last week, this month, last month, this quarter, last quarter, and last year.
Recently, due to work requirements, various report data needs to be collected. SQL statements are
Mysql groups the field time by day, month, or year.
Assume that the table has a time field in Unix timestamp format. You need to calculate the number of records per day based on this field.
Method:
Use the convert function convert (char (10), time, 1
Get System Current DateTime: Sysdate () Gets the system current date: Curdate () Gets the system current time: Curtime () Gets the year of the given date: yearly (date) Gets the month of the given date: month (date) A function that adds a time
onTo say there is an article table article, the time to store an article's added article is the Add_time field, which is an int (5) type, you now need to query the total number of articles added today and sort by time from large to small, then the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.